package com.example.deertrip;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.SimpleAdapter;
import android.widget.TextView;

import com.example.deertrip.database.DBOperate;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

public class Flight_Choose_Activity extends AppCompatActivity {
    private List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();

    private SimpleAdapter simpleAdapter = null;
    private DBOperate dbOperate;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_flight_choose);
        Button button_buy1;
        Button button_buy2;
        Button button_buy3;
        button_buy1=(Button) findViewById(R.id.buy1);
        button_buy2=(Button) findViewById(R.id.buy2);
        button_buy3=(Button) findViewById(R.id.buy3);

        button_buy1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent=new Intent(Flight_Choose_Activity.this, activity_pay_Activity.class);
                startActivity(intent);
            }
        });
        button_buy2.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent=new Intent(Flight_Choose_Activity.this, activity_pay_Activity.class);
                startActivity(intent);
            }
        });
        button_buy3.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent=new Intent(Flight_Choose_Activity.this, activity_pay_Activity.class);
                startActivity(intent);
            }
        });
        TextView CompanyName=findViewById(R.id.tv_8);
        TextView FlightForm=findViewById(R.id.tv_3);
        TextView FlightTo=findViewById(R.id.tv_4);
        TextView TotalHour=findViewById(R.id.tv_5);
        TextView TakeoffTime=findViewById(R.id.tv_6);
        TextView LandingTime=findViewById(R.id.tv_7);
        TextView TicketPrice=findViewById(R.id.tv_9);

        Bundle bundle=getIntent().getExtras();
        if(bundle!=null){
            CompanyName.setText((String)bundle.get("CompanyName"));
            FlightForm.setText((String)bundle.get("FlightForm"));
            FlightTo.setText((String)bundle.get("FlightTo"));
            TotalHour.setText((String)bundle.get("TotalHour"));
            TakeoffTime.setText((String)bundle.get("TakeoffTime"));
            LandingTime.setText((String)bundle.get("LandingTime"));
        }
    }
}